package com.sx.controller;

import java.sql.SQLException;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.annotation.BaseSeverlet;
import com.annotation.MethodAnnotation;
import com.dfec.utils.ResultHandler;
import com.sx.service.TempSearchService;

/**
 * Servlet implementation class WeatherKnow
 */
@WebServlet(name = "temp", description = "温度检索", urlPatterns = { "/temp" })
public class TempSearchController extends BaseSeverlet {
	private static final long serialVersionUID = 1L;
	TempSearchService ws = null;

	public TempSearchController() {
		super();
		// TODO Auto-generated constructor stub
		ws = new TempSearchService();
	}

	/**
	 * 普通查询
	 * 
	 * @param request
	 * @param response
	 */
	@MethodAnnotation(method = "ordinary")
	public void ordinaryList(HttpServletRequest request, HttpServletResponse response) {
		try {
			ResultHandler.handler(request, response, ws.ordinaryList(request), true);
		} catch (SQLException e) {
			e.printStackTrace();
		}

	}

	/**
	 * 高级
	 * 
	 * @param request
	 * @param response
	 */
	@MethodAnnotation(method = "senior")
	public void seniorDetails(HttpServletRequest request, HttpServletResponse response) {
		try {
			ResultHandler.handler(request, response, ws.seniorDetails(request), true);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

	/**
	 * 自定义
	 * 
	 * @param request
	 * @param response
	 */
	@MethodAnnotation(method = "custom")
	public void customSearch(HttpServletRequest request, HttpServletResponse response) {
		try {
			ResultHandler.handler(request, response, ws.customSearch(request), true);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
